<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>内联和内联块混用问题</title>
    <style>
    div{
        height: 50px;
        line-height: 50px;
        background: red;
        position: relative;
    }
    .position-center-y{
        position:absolute;
        top:50%;
        transform: translateY(-50%);
    }
    /* 存在无法居中问题,使用定位解决 */
    div>span:nth-of-type(1){
        margin-left:40px;
    }
    </style>
</head>
<body>
    <div>
       <img class="position-center-y" src="images/location.png" alt=""> <span>span</span><span>span</span>
    </div>
</body>
</html>